feat(serve): artifact view source link opens the /source viewer at the artifact line (REQ-243, #623)#653
Merged
Merged
Conversation
📐 Rivet artifact delta
Graphgraph LR
REQ_243["REQ-243"]:::modified
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Modified
Posted by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…e artifact line (REQ-243, #623) The artifact detail view showed the source file but the link was a dead `href="#"` that did nothing in a plain browser — it only worked via the VSIX editor shim. It now deep-links into the built-in `/source` viewer at the artifact's definition line (hx-get + hx-push-url, scrolling to the line), while keeping the `data-source-file`/`data-source-line` attributes so the VSIX webview shim still opens the file in the editor. The VSIX webview loads no htmx, so the two runtimes don't collide: browser follows hx-get, VSIX follows the shim. The header file link uses a distinct `source-file-link` class (not the `source-ref-link` used by inline cited-source refs) so selectors that pick the first inline source ref on the detail page keep working — the Playwright aadl.spec.ts test asserts the first `a.source-ref-link` is an `.aadl` ref. Off-by-one: the `/source` viewer numbers rows 1-based, so the browser scroll target is `source_line + 1`; `data-source-line` stays 0-based for the VSIX host, which consumes it as a 0-based position. Confirmed with a live server (deep-link present, /source returns 200 for REQ-001, scroll lands on the artifact line), the full serve_integration suite (47/47), cargo clippy --all-targets -- -D warnings, and cargo fmt --check — all green. Implements: REQ-243 Verifies: REQ-243 Refs: FEAT-001
f7a44a7 to
3ecc188
Compare
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 3ecc188 | Previous: cdeb7f8 | Ratio |
|---|---|---|---|
store_insert/10000 |
19780009 ns/iter (± 1960487) |
16453856 ns/iter (± 1176580) |
1.20 |
This comment was automatically generated by workflow using github-action-benchmark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements REQ-243 (
#623): therivet serveartifact detail view's source link now deep-links into the built-in/sourceviewer at the artifact's definition line. Previously it was a deadhref="#"that did nothing in a plain browser — the open-at-location behavior only existed in the VSIX extension.Two runtimes, one anchor
hx-get="/source/{path}"+hx-target="#content"+hx-push-url, and anonclickscrolls to the artifact's line.shell.tsshim intercepts thedata-source-file/data-source-lineattributes and opens the file in the editor.The VSIX webview loads no htmx, so the two paths never collide — verified by inspecting
vscode-rivet/src/shell.ts(only mermaid + the inline shim are loaded).Off-by-one (deliberate)
The
/sourceviewer numbers rows 1-based, so the browser scroll target issource_line + 1.data-source-linestays 0-based for the VSIX host, which consumes it as a 0-basedvscode.Position.Verification
serve_integrationtestartifact_detail_source_link_opens_source_viewasserts the detail HTML carrieshx-get="/source/,href="/source/,data-source-file=,data-source-line=, and the scroll target./artifacts/REQ-001emits the deep-link;GET /source/<encoded path>returns 200; scroll target lands on the artifact's line.serve_integrationsuite 47/47;cargo clippy --all-targets -- -D warningsexit 0;cargo fmt --checkclean;rivet validatePASS.Traceability
verified)🤖 Generated with Claude Code